package com.company.math;

/**
 * @author jrue
 * @description https://leetcode-cn.com/problems/power-of-four/
 * @date 2019/11/14 10:09
 */
public class IsPowerOfFour {

    public static void main(String[] args) {
        System.out.println(new IsPowerOfFour().isPowerOfFour(4));
    }

    public boolean isPowerOfFour(int num) {
        while (num != 0 && num % 4 == 0) {
            num = num /4;
        }

        return num == 1;
    }
}
